
import socket

def server():
    s = socket.socket()

    HOST = "127.0.0.1"
    PORT = 6666

    s.bind((HOST,PORT))

    s.listen(5)

    while  True:
        c, addr = s.accept()
        print("Connect client" , addr)
        msg = c.recv(1024)

        print("From client: %s" % msg)
        c.send(msg)
    pass


if __name__ == "__main__":
    server()
    pass